#ifndef __ECHO_H__
#define __ECHO_H__

#include <stdio.h>
#include <string>

#include "../Utils/tcpserver.h"
#include "../Utils/tcpconnection.h"

#include "Utils/buffer.h"

static const int thread_nums = 8;

namespace tiny_muduo
{
    class Address;
    class EventLoop;
}

class EchoServer
{
public:
    EchoServer(tiny_muduo::EventLoop* loop, const tiny_muduo::Address& listen_addr);
    ~EchoServer() = default;

    void Start()
    {
        server_.Start();
    }

    void ConnectionCallback(const tiny_muduo::TcpConnectionPtr& ptr, tiny_muduo::Buffer* buffer)
    {
        printf("echo_server has a new connection \n");
    }

    void MessageCallback(const tiny_muduo::TcpConnectionPtr& ptr, tiny_muduo::Buffer* buffer)
    {
    }

private:
    tiny_muduo::EventLoop* loop_;
    tiny_muduo::TcpServer server_;
};

#endif

